package com.wuxf.service;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wuxf.entity.CarArea;
import com.wuxf.mapper.custom.CarAreaMapper;

@Service
@SuppressWarnings({"rawtypes"})
public class CarAreaService {
	@Autowired
	private CarAreaMapper carAreaMapper;
	
	public List<CarArea> findByMap(HashMap paraMap){
		return carAreaMapper.findByMap(paraMap);
	}
	
	public PageInfo<List<CarArea>> findByMapAndPage(HashMap paraMap,PageInfo pageInfo){
		PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
		return new PageInfo(carAreaMapper.findByMap(paraMap));
	}
	
	public void saveCarArea(CarArea carArea){
		carAreaMapper.saveCarArea(carArea);
	}
	
	public void deleteCarArea(int carAreaId){
		carAreaMapper.deleteCarArea(carAreaId);
	}

	public int checkCarNoAndArea(HashMap paraMap) {
		return carAreaMapper.checkCarNoAndArea(paraMap);
	}
	
	
}
